fix int types and handling

handles issues #10 and #11 cc @jehiah