Fixed prototype declarations so the correct methods are called.