Fix quest system, fixes #1006