Fixed a bug in DB.java thanks to Enrico