Update firmware checking code.

Updated firmware checking code using iBaa's method