fixed issues in Stored Procedures and some layout issues

fixed issues in Stored Procedures and some layout issues