Fixed template and removed is_integer check