Fixed fatal error, closes #868