free reference pointer, fix indentation

resolves #240