Minor fixes to make it more compatible with older versions