Fixed isue with internal mis-named global variable "container". Now local variable $container.
Adding missing semi colons.