Bug fixes

Fixed method signature, some compiler warnings and a logic issue with pressing the segment/button.