Fixed bug where not checking last reading for NULL