are you sure the userlevels are being set as you expect?
add the following code to your page just before the </body> tag:
<?php var_dump($_SESSION); ?>
this will show the contents of the session variables.
I suspect the user you are testing with has the userlevel set to 2 when it should be set to 1,
for the menu issue, you have a paragraph at line 105:
outside the access rules, this is probably the cause of the menu you are seeing.