Fixed setPmax bugs and FF type bugs