Fix #5 and minor improvements

Use getVersion() where possible and remove unnecessary code.