Fixed incorrect load order.
Fixed API NPE.