fixed issues raised by @turicas