Fixed dynamic linking issues for Ubuntu and improved overall working