fixing some entry-point bugs