Awful fix waiting for refactor. Not proud of it...