Improve init script to not hang.