* Fixed bug in the stale connection check * Tweaked the process of connection allocation for a slightly better readability