File upload and some other small bugs fixed.
Database bug fixed