Fixing some record locking issues

Also fixed DOB NaN problem in javascript.php