A nicer, neater pull request :) Closes #544 closes #513

Ahhh... much better!