Majorly fixes some ordering of callback functions.