Fixed fatal error, fixes #774