Fixed issue #523: Minor fixes