Fixed if statement race conditions. Updated to version 0.2.4