Couple of bugs fixed for procedures and others