Couple of fixes thanks to DavidS