Added tests; Fixed minor issues in Connection and ActiveRecord classes