Fix registration and application queries