fix possible comparison with nil and automatic point calculation