Fixed nil errors