Fixed onInitEnd from 7f9b1b6df9d5cba10d284d92054c9d066a098c19. Code was never reached before the return statements in the ifs above