Build bug fix

Made changes required to resolve #35. Please take a look and make sure this doesn't mess things up on your systems.