Error reported via email by Pete Shinners <pete@visionart.com>. Fixed some indentation inconsistencies.
Thanks to Hubert Hoegl <hubert.hoegl@dlr.de> for finding this bug.