Fixes redmine #210, Fixes redmine #207,  Fixes redmine #220,

stuck 220 on there because I fixed it earlier but didnt know how to
close it