Fixed undefined prepareStatements in tests