Fixed issues introduced in 0621b58c54 (according to Simon's comments)