fixes, adjustments for better compiler compatibility