Some fixes and improvements
All specs pass