Please read commit 2bf80528bdb2814331f9149289a0dd1e3422282b first. Then read the comment within the code of this commit. Then run in circles and cry loudly. fixes #1002 fixes #1026