Fixed two fatal errors