performance enhancements applied and GCC/Linux warnings fixed