Removed unneeded if/else blocks; fixed chunk header alignment issue