Fixed previous bug. More bugs discovered. #2