Fixed references to undefined