Fixed stored procedure bug.