Fix #39 and minor indentation corrections