Added PDO defaults. Smartened up user id fetching.