Deb 0.5.1

merge for 0.5.1 branch, plus several hot-fixes that were severely affecting usability.