fixed some minor errors + mysql prepare problem