some minor improvements on the C++-code