Rescuing errors on reading and added tests

Signed off by: Daniel Alves <danpaulalves@gmail.com>