Fix up loading state and all that crazy stuff