Fixes #121.
Fixes #1267.
Fixes #1288.
Merge pull request #1410 from Petethegoat/fixes

Issue fixes