Bug fixes
Updated tests