Fixed issues with #39, Worked on #47

Could not fully test due to exceptions