Bug in sorting plan.

Was not returning anything.
Make the Makefile more automatic.

Sorry, when I see a Makefile with hardcoded everything, it makes me sad.
Merge branch 'master', remote-tracking branch 'mzlee/master'
post-merge updates