Cleanup

Couldn't get this to run on OS X, check if this still works before merging.