fixed compiler warnings
fixed MAX_PACKAGE_SIZE too get rid of SEGFAULTS