fixed compiler warnings, unused vars
fixed compiler warning, missing return value
fixed compiler warning, comparision always false due to limited type