Fixed build and packaging bugs