Fixed bug in take method and added more tests