Bug fix for integer verification and minor optimization