Fixing some test issues and improve some methods