Fixing bugs with PDO init and SQL parsing