Tidy up code

Tidy up code
Fix analog invert check

Fixing bitread call for analoginvert, missing an (, ), and =