Disgustingly hacky bug fix