Fixed conversions between bytes and int
Updated thread library import