Minor performance fixes

Not using HasFlag().
Not using BitConverter anymore