Fix for #261 thanks to UF