Fix compile error and strip newline from variable in AIX.