Replaced inline if else for 2.4 compatibility.
Used six.b function for 2.4 compatibility.