Further bug fix, something's still not right though