Feature/cleanup

@otherjonvb Added spec to test previous pull request's bug fix. You'll probably want to view the diff with the ?w=0 parameter in the URL to hide whitespace changes