Added more configuration options, based on patch by Uli Köhler