Fixed parse method and added some tests