Closes #53. Also fixed minor errors being thrown under certain circumstances.