fixing bugs

repair checking prefixes
repair test in main