Add compile warnings, fix indentation, add unit test