Adding some test and fixing some behaviors