Added pre-cond checks to readValues to prevent OutOfMemory bug