fixed some compile issues on Java6